#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<math.h>

int main()
{
	char a[8];
	int b = 0;
	int flag = 0;
	while (scanf("%s", a) != EOF)
	{
		if (a[0] == 'O' && a[1] == 'T' && a[2] == 'T' && a[3] == 'E' && a[4] == 'R')
		{
			flag = 1;
		}
		b = (a[5] - '0') * 100 + (a[6] - '0') * 10 + (a[7] - '0');
		if (b >= 0 && b <= 256)
			flag = 1;
		else
			flag = 0;
		if (a[5] - '0' < 0 || a[5] - '0' > 9)
			flag = 0;
		if (a[6] - '0' < 0||a[6] - '0' > 9)
			flag = 0;
		if (a[7] - '0' < 0 ||a[7] - '0' > 9)
			flag = 0;
		
		if (1 == flag)
		{
			printf("Valid\n");
		}
		else
			printf("Invalid\n");

	}
	return 0;
}